module.exports = app => {
  const { router, controller, jwt } = app;
  router.get('/admin/index', controller.admin.main.index);
  // 后台登录接口 返回一个token
  router.post('/admin/checkLogin', controller.admin.main.checkLogin);
  router.get('/admin/getTypeInfo',jwt, controller.admin.main.getTypeInfo);
  // 添加文章
  router.post('/admin/addArticle', jwt, controller.admin.main.addArticle);
  // 修改文章内容
  router.post('/admin/updateArticle', jwt, controller.admin.main.updateArticle);
  // 添加随笔
  router.post('/admin/addEssay', jwt, controller.admin.main.addEssay);
  // 更新随笔
  router.post('/admin/updateEssay', jwt, controller.admin.main.updateEssay);
  router.get('/admin/getArticleList', jwt, controller.admin.main.getArticleList);
  // 删除文章
  router.get('/admin/delArticle', jwt, controller.admin.main.delArticle);
  router.get('/admin/getArticleById',jwt, controller.admin.main.getArticleById);
  // markdown上传图片
  router.post('/admin/saveUploadImg', jwt, controller.admin.main.saveUploadImg);
  // 随心笔记上传图片
  router.post('/admin/saveEssayImg', jwt, controller.admin.main.saveEssayImg);
  // 获取随笔列表
  router.get('/admin/getEssayList', jwt, controller.admin.main.getEssayList);
  // 删除随笔
  router.get('/admin/delEssay', jwt, controller.admin.main.delEssay);
  // 获取留言信息
  router.get('/admin/getMessageList', jwt, controller.admin.main.getMessageList);
  // 更新留言的状态
  router.post('/admin/updateMessageStatus', jwt, controller.admin.main.updateMessageStatus);
}